package com.easy.cloud.web.service.upms.api.feign;

import cn.hutool.json.JSONObject;
import com.easy.cloud.web.component.core.constants.ServiceNameConstants;
import com.easy.cloud.web.component.core.response.HttpResult;
import com.easy.cloud.web.service.upms.api.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author GR
 * @date 2021-11-8 11:33
 */
@FeignClient(contextId = "upmsFeignClientService", value = ServiceNameConstants.UPMS_SERVICE)
public interface UpmsFeignClientService {
    /**
     * 根据用户名获取登录信息
     *
     * @param userName 用户名称
     * @return com.easy.cloud.web.component.core.response.HttpResult<com.easy.cloud.web.service.upms.api.domain.User>
     */
    @GetMapping("user/account/login/detail")
    HttpResult<UserVO> loadUserByUsername(@RequestParam("userName") String userName);

    /**
     * 获取第三方登录信息
     *
     * @param jsonObject 登录信息
     * @return com.easy.cloud.web.component.core.response.HttpResult<com.easy.cloud.web.service.upms.api.domain.User>
     */
    @PostMapping("user/social/login/detail")
    HttpResult<UserVO> loadSocialUser(@RequestBody JSONObject jsonObject);
}
